package com.aspose.cells;

import java.util.ArrayList;

public class ChartPoint {
   private Series b;
   private zor c;
   int a;
   private DataLabels d;
   private Object e = null;
   private Object f = null;
   private ShapePropertyCollection g;
   private float h;
   private float i;
   private float j;
   private float k;
   private float l;
   private float m;
   private float n;
   private ArrayList o = new ArrayList();
   private ArrayList p = new ArrayList();
   private ArrayList q = new ArrayList();

   ChartPoint(Series series, int index) {
      this.b = series;
      this.a = index;
   }

   Series a() {
      return this.b;
   }

   int b() {
      return this.b.getType();
   }

   zor c() {
      if (this.c == null) {
         this.c = new zor(this);
         CopyOptions var1 = new CopyOptions(true);
         if (this.b.g() != null) {
            this.c.a(this.b.f(), var1);
         } else if (this.b.s().e() != null) {
            this.c.a(this.b.s().d(), var1);
         }
      }

      return this.c;
   }

   void a(zor var1) {
      this.c = var1;
   }

   public int getExplosion() {
      if (this.c != null && this.c().i() != null) {
         return this.c().l().a();
      } else {
         return this.b != null ? this.b.getExplosion() : 0;
      }
   }

   public void setExplosion(int value) {
      if (ChartCollection.c(this.b()) || ChartCollection.m(this.b())) {
         this.c().l().a(value);
      }

   }

   boolean d() {
      if (this.c != null && this.c().i() != null) {
         return false;
      } else {
         return this.b != null ? this.b.y() : true;
      }
   }

   public boolean getShadow() {
      if (this.c == null) {
         return this.b.g() != null ? this.b.f().q() : false;
      } else {
         return this.c().q();
      }
   }

   public void setShadow(boolean value) {
      this.c().f(value);
   }

   boolean e() {
      return this.c == null ? true : this.c.a();
   }

   public Line getBorder() {
      return this.c().f();
   }

   Line f() {
      return this.c == null ? null : this.c().g();
   }

   public Area getArea() {
      return this.c().e();
   }

   Area g() {
      return this.c == null ? null : this.c().h();
   }

   public Marker getMarker() {
      if (this.h() == null && this.a() != null && this.a().u() != null) {
         Marker var1 = this.c().j();
         var1.a(this.a().getMarker(), (CopyOptions)null);
      }

      return this.c().j();
   }

   Marker h() {
      return this.c == null ? null : this.c().k();
   }

   zjc i() {
      return this.c == null ? null : this.c().i();
   }

   /** @deprecated */
   public int getMarkerStyle() {
      return this.getMarker().getMarkerStyle();
   }

   /** @deprecated */
   public void setMarkerStyle(int value) {
      this.getMarker().setMarkerStyle(value);
   }

   /** @deprecated */
   public int getMarkerSize() {
      return this.getMarker().getMarkerSize();
   }

   /** @deprecated */
   public void setMarkerSize(int value) {
      if (value >= 2 && value <= 72) {
         this.getMarker().setMarkerSize(value);
      }

   }

   /** @deprecated */
   public Color getMarkerForegroundColor() {
      return this.getMarker().d();
   }

   /** @deprecated */
   public void setMarkerForegroundColor(Color value) {
      this.getMarker().a(value);
   }

   /** @deprecated */
   public int getMarkerForegroundColorSetType() {
      return this.getMarker().e();
   }

   /** @deprecated */
   public void setMarkerForegroundColorSetType(int value) {
      this.getMarker().c(value);
   }

   /** @deprecated */
   public Color getMarkerBackgroundColor() {
      return this.getMarker().f();
   }

   /** @deprecated */
   public void setMarkerBackgroundColor(Color value) {
      this.getMarker().b(value);
   }

   /** @deprecated */
   public int getMarkerBackgroundColorSetType() {
      return this.getMarker().g();
   }

   /** @deprecated */
   public void setMarkerBackgroundColorSetType(int value) {
      this.getMarker().d(value);
   }

   public DataLabels getDataLabels() {
      if (this.d == null) {
         this.d = new DataLabels(this, this.b.h().d());
         CopyOptions var1 = new CopyOptions(true);
         if (this.b.p() != null) {
            this.d.a(this.b.getDataLabels(), var1);
            this.d.q = false;
         }
      }

      return this.d;
   }

   DataLabels j() {
      return this.d;
   }

   public Object getYValue() {
      return this.e;
   }

   public void setYValue(Object value) {
      this.e = value;
   }

   public Object getXValue() {
      return this.f;
   }

   public void setXValue(Object value) {
      this.f = value;
   }

   void a(ChartPoint var1, CopyOptions var2) {
      this.a = var1.a;
      if (var1.c != null) {
         this.c = new zor(this);
         this.c.a(var1.c, var2);
      }

      if (var1.d != null) {
         this.d = new DataLabels(this, this.b.h().d());
         this.d.a(var1.d, var2);
      }

      if (var1.g != null) {
         this.g = new ShapePropertyCollection(this.a().s().a().a(), this, 5);
         this.g.a(var1.g, var2);
      }

   }

   public ShapePropertyCollection getShapeProperties() {
      if (this.g == null) {
         this.g = new ShapePropertyCollection(this.a().s().a().a(), this, 5);
      }

      return this.g;
   }

   public int getShapeX() {
      return (int)((double)(this.h * 4000.0F / (float)this.k().getChartObject().getWidth()) + 0.5D);
   }

   public int getShapeY() {
      return (int)((double)(this.i * 4000.0F / (float)this.k().getChartObject().getHeight()) + 0.5D);
   }

   public int getShapeWidth() {
      return (int)((double)(this.j * 4000.0F / (float)this.k().getChartObject().getWidth()) + 0.5D);
   }

   public int getShapeHeight() {
      return (int)((double)(this.k * 4000.0F / (float)this.k().getChartObject().getHeight()) + 0.5D);
   }

   private Chart k() {
      return this.b.s().a().a();
   }

   public int getShapeXPx() {
      return (int)((double)this.h + 0.5D);
   }

   public int getShapeYPx() {
      return (int)((double)this.i + 0.5D);
   }

   public int getShapeWidthPx() {
      return (int)((double)this.j + 0.5D);
   }

   public int getShapeHeightPx() {
      return (int)((double)this.k + 0.5D);
   }

   public int getBorderWidthPx() {
      return (int)(this.getBorder().getWeightPt() * (double)this.b.i().L() / 72.0D + 0.5D);
   }

   public int getRadiusPx() {
      return (int)((double)this.j + 0.5D);
   }

   public int getInnerRadiusPx() {
      return (int)((double)this.l + 0.5D);
   }

   public float getStartAngle() {
      return this.m;
   }

   public float getEndAngle() {
      return this.n;
   }

   public float getArcStartPointXPx() {
      return this.a((double)this.getShapeXPx(), (double)(-this.getStartAngle()), (double)this.getRadiusPx());
   }

   public float getArcStartPointYPx() {
      return this.b((double)this.getShapeYPx(), (double)(-this.getStartAngle()), (double)this.getRadiusPx());
   }

   public float getArcEndPointXPx() {
      return this.a((double)this.getShapeXPx(), (double)(-this.getEndAngle()), (double)this.getRadiusPx());
   }

   public float getArcEndPointYPx() {
      return this.b((double)this.getShapeYPx(), (double)(-this.getEndAngle()), (double)this.getRadiusPx());
   }

   public float getInnerArcStartPointXPx() {
      return this.a((double)this.getShapeXPx(), (double)(-this.getStartAngle()), (double)this.getInnerRadiusPx());
   }

   public float getInnerArcStartPointYPx() {
      return this.b((double)this.getShapeYPx(), (double)(-this.getStartAngle()), (double)this.getInnerRadiusPx());
   }

   public float getInnerArcEndPointXPx() {
      return this.a((double)this.getShapeXPx(), (double)(-this.getEndAngle()), (double)this.getInnerRadiusPx());
   }

   public float getInnerArcEndPointYPx() {
      return this.b((double)this.getShapeYPx(), (double)(-this.getEndAngle()), (double)this.getInnerRadiusPx());
   }

   void a(float var1, float var2) {
      this.h = var1;
      this.i = var2;
   }

   void b(float var1, float var2) {
      this.j = var1;
      this.k = var2;
   }

   void c(float var1, float var2) {
      this.m = var1;
      this.n = var2;
   }

   void a(float var1) {
      this.l = var1;
   }

   private float a(double var1, double var3, double var5) {
      double var7 = var3 * 3.141592653589793D / 180.0D % 6.283185307179586D;
      double var9 = var5 * Math.cos(var7);
      var9 += var1;
      return (float)var9;
   }

   private float b(double var1, double var3, double var5) {
      double var7 = var3 * 3.141592653589793D / 180.0D % 6.283185307179586D;
      double var9 = var5 * Math.sin(var7);
      var9 = var1 - var9;
      return (float)var9;
   }

   public int getTopPointCount() {
      return this.o.size();
   }

   public float getTopPointXPx(int index) {
      if (index >= this.getTopPointCount()) {
         throw new CellsException(0, "index must be less than GetTopPointCount()");
      } else {
         return ((com.aspose.cells.b.a.b.zo)this.o.get(index)).d();
      }
   }

   public float getTopPointYPx(int index) {
      if (index >= this.getTopPointCount()) {
         throw new CellsException(0, "index must be less than GetTopPointCount()");
      } else {
         return ((com.aspose.cells.b.a.b.zo)this.o.get(index)).e();
      }
   }

   public int getBottomPointCount() {
      return this.p.size();
   }

   public float getBottomPointXPx(int index) {
      if (index >= this.getBottomPointCount()) {
         throw new CellsException(0, "index must be less than GetBottomPointCount()");
      } else {
         return ((com.aspose.cells.b.a.b.zo)this.p.get(index)).d();
      }
   }

   public float getBottomPointYPx(int index) {
      if (index >= this.getBottomPointCount()) {
         throw new CellsException(0, "index must be less than GetBottomPointCount()");
      } else {
         return ((com.aspose.cells.b.a.b.zo)this.p.get(index)).e();
      }
   }

   void a(ArrayList var1, ArrayList var2) {
      int var3;
      for(var3 = 0; var3 < var1.size(); ++var3) {
         com.aspose.cells.b.a.a.ze.a(this.o, (Object)(new com.aspose.cells.b.a.b.zo(((com.aspose.cells.b.a.b.zo)var1.get(var3)).d(), ((com.aspose.cells.b.a.b.zo)var1.get(var3)).e())));
      }

      for(var3 = 0; var3 < var2.size(); ++var3) {
         com.aspose.cells.b.a.a.ze.a(this.p, (Object)(new com.aspose.cells.b.a.b.zo(((com.aspose.cells.b.a.b.zo)var2.get(var3)).d(), ((com.aspose.cells.b.a.b.zo)var2.get(var3)).e())));
      }

   }

   public int getOnCategoryAxisPointCount() {
      return this.q.size();
   }

   public float getOnCategoryAxisPointXPx(int index) {
      if (index >= this.getOnCategoryAxisPointCount()) {
         throw new CellsException(0, "index must be less than GetOnCategoryAxisPointCount()");
      } else {
         return ((com.aspose.cells.b.a.b.zo)this.q.get(index)).d();
      }
   }

   public float getOnCategoryAxisPointYPx(int index) {
      if (index >= this.getOnCategoryAxisPointCount()) {
         throw new CellsException(0, "index must be less than GetOnCategoryAxisPointCount()");
      } else {
         return ((com.aspose.cells.b.a.b.zo)this.q.get(index)).e();
      }
   }

   void a(ArrayList var1) {
      for(int var2 = 0; var2 < var1.size(); ++var2) {
         com.aspose.cells.b.a.b.zo var3 = (com.aspose.cells.b.a.b.zo)var1.get(var2);
         com.aspose.cells.b.a.a.ze.a(this.q, (Object)(new com.aspose.cells.b.a.b.zo(var3.d(), var3.e())));
      }

   }
}
